#include <iostream>
#include <string>
#include <regex>
using namespace std;

int main() {
	string s;
	cin >> s;
	regex r("[a-zA-Z0-9\_]+@[a-zA-Z0-9]+(\.(com))");
	if (regex_match(s, r))
		cout << "YES";
	else
		cout << "NO";
	return 0;
}